﻿@using Magicodes.Admin.Contents
@using Magicodes.Admin.Dto
@{
    var headerNavs = ViewData["HeaderNav"] as ICollection<TreeTableRowDto<ColumnInfo>>;
    var isIndex = ViewBag.Source != null;
}
<div class="ed_header_bottom">
    <div class="container">
        <div class="row">
            <div class="col-lg-3 col-md-3 col-sm-3">
                <div class="pro_logo">
                    @if (isIndex)
                    {
                        <a href="/Home/Index"><img src="~/images/header/Logo_yellow.png" alt="logo" /></a>
                    }
                    else
                    {
                        <a href="/Home/Index"><img src="~/images/header/Logo.png" alt="logo" /></a>
                    }
                </div>
            </div>
            <div class="col-lg-9 col-md-9 col-sm-9">
                <div class="pro_menu_toggle navbar-toggle" data-toggle="collapse" data-target="#ed_menu">
                    Menu
                    <i class="fa fa-bars"></i>
                </div>
                <div class="pro_menu">
                    <ul class="collapse navbar-collapse" id="ed_menu">
                        <li>
                            <a href="/Home/Index">
                                首页
                            </a>
                        </li>
                        @if (headerNavs?.Count > 0)
                        {
                            foreach (var nav in headerNavs)
                            {
                                <li>
                                    <a href="@nav.Data.Url">
                                        @nav.Data.Title
                                    </a>
                                    @if (nav.Children.Count > 0)
                                    {
                                        <ul class="sub-menu">
                                            @foreach (var item in nav.Children)
                                            {
                                                <li>
                                                    <a href="@item.Data.Url">@item.Data.Title</a>
                                                </li>
                                            }
                                        </ul>
                                    }
                                </li>
                            }
                        }
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>